package com.guo;

import org.junit.Test;

/**
 * @author gonghuaiguo
 */
public class StringTest {


    @Test
    public void test() {
        int superInt = SuperClass.superInt;
        System.out.println("superInt = " + superInt);
        SuperClass superClass = new SuperClass();
        System.out.println(superClass.superInt2);;
    }


}

class SuperClass{

    public SuperClass() {
        System.out.println("superClass 构造器初始化");
    }
    public static int superInt = 2;
    private static String superString = "hello super";

    protected int superInt2 = 3;
    {
        superInt++;
        superInt2++;
        System.out.println("superClass 代码块初始化superInt2=" +superInt2 +"; superInt=" + superInt);
    }

    public Person person1 = new Person(1);

    static {
        superInt++;
        System.out.println("superClass static 代码块初始化" +superInt);
    }
    public static Person person = new Person("张三",2);

}

class subClass extends SuperClass{

    private static int subInt = 0;

}